From 80a610618c9a0fb1cdb05849ae4f2b6bce3de7d9 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 24 Sep 2008 08:36:44 +0000 Subject: [PATCH] Fix unnecessary GlobalFunctions.php bloat from r41148 --- includes/GlobalFunctions.php | 17 ----------------- includes/RecentChange.php | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 440791eeaf..34260c7ff2 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2907,20 +2907,3 @@ function wfStripIllegalFilenameChars( $name ) { $name = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $name ); return $name; } - -/** - * Send some text to - * @param string $line - */ -function wfRecentChange2UDP( $line ) { - global $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix; - # Notify external application via UDP - if( $wgRC2UDPAddress ) { - $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); - if( $conn ) { - $line = $wgRC2UDPPrefix . $line; - socket_sendto( $conn, $line, strlen($line), 0, $wgRC2UDPAddress, $wgRC2UDPPort ); - socket_close( $conn ); - } - } -} diff --git a/includes/RecentChange.php b/includes/RecentChange.php index b1c70d8d5a..a2f965c3a2 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -210,7 +210,7 @@ class RecentChange # Notify external application via UDP if ( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) { - wfRecentChange2UDP( $this->getIRCLine() ); + self::sendToUDP( $this->getIRCLine() ); } # E-mail notifications @@ -239,6 +239,23 @@ class RecentChange wfRunHooks( 'RecentChange_save', array( &$this ) ); } + /** + * Send some text to UDP + * @param string $line + */ + static function sendToUDP( $line ) { + global $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix; + # Notify external application via UDP + if( $wgRC2UDPAddress ) { + $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); + if( $conn ) { + $line = $wgRC2UDPPrefix . $line; + socket_sendto( $conn, $line, strlen($line), 0, $wgRC2UDPAddress, $wgRC2UDPPort ); + socket_close( $conn ); + } + } + } + /** * Mark a given change as patrolled * -- 2.20.1